// 供应链

import Log from '@/pages/order/aftersale/log.vue';
import { request, hotelRequest } from '@/sheep/request';

export default {
  //资源包列表
  supply_list: (params) =>
    request({
      url: '/hotel/api/supply/assets',
      method: 'GET',
      params,
    }),

  // 资源包详情
  supply_info: (params, id) =>
    request({
      url: '/hotel/api/supply/assets/' + id,
      method: 'GET',
      params,
    }),

  //酒店采购预下单
  create_pre_order: (data) =>
    request({
      url: `/hotel/api/supply/order/pre`,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 酒店采购下单
  create_order: (data) =>
    request({
      url: `/hotel/api/supply/order/create`,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  //订单列表
  order_list: (params) =>
    request({
      url: '/hotel/api/supply/order/listtwo',
      method: 'GET',
      params,
    }),

  // order_list: (params) =>
  // 	request({
  // 		url: '/hotel/api/supply/order',
  // 		method: 'GET',
  // 		params,
  // 	}),

  // 订单详情
  order_info: (id) =>
    request({
      url: '/hotel/api/supply/order/detailtwo/' + id,
      method: 'GET',
    }),

  // 子公司 确认订单
  // /hotel/api/supply/order/submitSupplier/CG202504132366692829003000
  // confirm_order_zgs: (id) => request({
  //     url: `/hotel/api/supply/order/submitSupplier/` + id,
  //     method: 'POST',
  // }),

  // 供货商 确认订单
  // /hotel/api/supply/order/submitSupplier/CG202504132366692829003000
  confirm_order_ghs: (id) =>
    request({
      url: `/hotel/api/supply/order/submitSupplier/` + id,
      method: 'POST',
    }),

  // 驳回订单
  // /hotel/api/supply/order/back/CG202504132366692829003000
  order_back: (data, id) =>
    request({
      url: `/hotel/api/supply/order/back/` + id,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 供货商 确认出库
  // /hotel/api/supply/order/outGoods/CG202504132366692829003000
  outGoods: (id) =>
    request({
      url: `/hotel/api/supply/order/outGoods/` + id,
      method: 'POST',
    }),

  // 供货商 确认收货(上传签收凭证)
  // /hotel/api/supply/order/upProve/CG202502550382621236005000
  upload_prove: (data, id) =>
    request({
      url: `/hotel/api/supply/order/upProve/` + id,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 酒店   取消订单
  cancel_order: (data, id) =>
    request({
      url: `/hotel/api/supply/order/cancel/` + id,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 查看凭证
  // /hotel/api/supply/order/getProve/CG202504132366692829003000
  prove_info: (id) =>
    request({
      url: '/hotel/api/supply/order/getProve/' + id,
      method: 'GET',
    }),
  // 酒店   修改数量

  // 资源包商品详情
  // /hotel/api/supply/assets/goodsContent/1
  goodsContent: (id) =>
    request({
      url: '/hotel/api/supply/assets/goodsContent/' + id,
      method: 'GET',
    }),

  // 酒店身份查询
  getUserRole: (id) =>
    request({
      url: '/hotel/api/supply/supplier/getUserRole',
      method: 'GET',
    }),

  // 合同列表
  hetong_list: (params, id) =>
    request({
      url: '/hotel/api/supply/assets/contract/' + id,
      method: 'GET',
      params,
    }),

  // create_coupon_order: (data) => request({
  //     url: `/hotel/api/coupon/create`,
  //     method: 'POST',
  //     data: {
  //         ...data
  //     }
  // }),
};
